#include "includesDPC.h"
#include "ScanDataDPC.h"
#include "pocsDPC.h"
//Constructor
using namespace std;
ScanData::ScanData (int ng ,double gmi ,double gma, int nt, double tmi, double tma , double rad, int nx, int ny, double x0 )
{
	Ng = ng;
	Nt = nt;
	Nx = nx;
	Ny = ny;
	gmin = gmi;
	gmax= gma;
	tmin = ShiftPosition(tmi);
	tmax = ShiftPosition(tma);
	R = rad;
	X2 = x0*x0;
	xmin = -x0;
	xmax = x0;
	ymin = xmin * Ny/Nx;
	ymax = xmax * Ny/Nx;
	dg=(gmax-gmin)/(Ng-1.);
	dt=(2.*M_PI)/(Nt);
	dx = (xmax-xmin)/(Nx-1.);
	dy = dx;
	rov = R*sin((gmax - gmin)/2.);	
	data = vector<vector<double> >  (Nt, vector<double> (Ng)); // needs to be set after construction
	Ddata = vector<vector<double> >  (Nt, vector<double> (Ng)); // needs to be set after construction
	recon = vector<vector<double> >  (Nx, vector<double> (Ny,0));
	APdata = vector<vector<double> >  (Nx, vector<double> (Ny,0)); // -M_PI_2, 3.*M_PI_2,needs to be set after construction
	APmask = vector<vector<bool> >  (Nx, vector<bool> (Ny, false)); // needs to be set after construction (A Priori) 1 = known
	CSmask = vector<vector<bool> >  (Nx, vector<bool> (Ny, false)); // needs to be set after construction (Compact Support) 1 = within CS

	DBPmask = vector<vector<bool> >  (Nx, vector<bool> (Ny, false));
	// Set zone of known DBP as true in DBPmask (use scanner FOV)
	double x,y;
	int i,j;
	for(i=0; i<Nx;i++){
		x = xmin + dx*i;
		for(j=0; j<Ny;j++){
			y = ymin + j*dx;
			DBPmask[i][j] = isHilbertKnown(*this, x, y);
		}
	}

	DBPdata = vector<vector<double> >  (Nx, vector<double> (Ny,0));
	FPdata = vector<double> (Ny,0);
	Lmask = vector<bool> (Ny,false);
	HT = vector<vector<double> >  (Nx, vector<double> (Ny,0));
}


